package com.onlyone.controller;

import com.onlyone.model.User;
import com.onlyone.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource
    private UserRepository userRepository;


    @GetMapping("/add")
    public Object add() {
        User user = User.builder().userName("TomGE").age(29).address("浙江省杭州市西湖区西雅图").build();
        Long uid = userRepository.addUser(user);
        return "success";
    }

}
